package com.ruoyi.web.controller.wq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wq.domain.WqPlayOrder;
import com.ruoyi.wq.domain.vo.WqPlayOrderVO;
import com.ruoyi.wq.service.IWqPlayOrderService;
import com.ruoyi.framework.web.service.PlayOrderService;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 陪玩订单Controller
 * 
 * @author ruoyi
 * @date 2023-09-11
 */
@RestController
@RequestMapping("/wq/playOrder")
public class WqPlayOrderController extends BaseController {

    @Autowired
    private IWqPlayOrderService wqPlayOrderService;
    
    @Autowired
    private PlayOrderService playOrderService;

    /**
     * 查询订单列表
     */
    @GetMapping("/list")
    public TableDataInfo list(WqPlayOrderVO wqPlayOrder){
        TableDataInfo info = wqPlayOrderService.getPageList(wqPlayOrder);
        return info;
    }

    /**
     * 下单陪玩
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody WqPlayOrder wqPlayOrder){
        return AjaxResult.success(playOrderService.savePlayOrder(wqPlayOrder));
    }

}
